<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style>
			*{
				margin: 0%;
				padding: 0%;
			}
			ul {
				list-style: none;
				overflow: hidden;
				margin-top: 80px;
			}
			ul li {
				float: left;
				height: 30px;
				width: 100px;
				text-align: center;
				line-height: 30px;
				color: #fff;
				background-color: #000;
			}
		</style>
	</head>
	<body>
		<ul id="box">
			<li>1</li>
			<li>2</li>
			<li>3</li>
			<li>4</li>
			<li>5</li>
		</ul>
		<script>
			window.onload = function() {
				let box = document.getElementById('box');
				box.onmouseover = function(e) {
					e = e || window.event;
					let target = e.target || e.srcElement;
					target.style.backgroundColor = 'blue';
				}
				box.onmouseout = function(e) {
					e = e || window.event;
					let target = e.target || e.srcElement;
					target.style.backgroundColor = 'black';
				}
			}
		</script>
	</body>
</html>